//  [10/9/2013 OMEGA] created

#include "DuelGUIECommon.h"
#include "DuelGUIEWorkbench.h"
#include "DuelGUIEActionManager.h"


static QActionGroup* createActionGroup(QObject *parent, bool exclusive = false)
{
	QActionGroup * rc = new QActionGroup(parent);
	rc->setExclusive(exclusive);
	return rc;
}

static QAction* createSeparator(QObject *parent)
{
	QAction * rc = new QAction(parent);
	rc->setSeparator(true);
	return rc;
}

DGUIEActionManager::DGUIEActionManager( DGUIEWorkbench* workbench ) :
	QObject(workbench),
	mWorkbench(workbench),
	mFileActions(createActionGroup(this)),
	mEditActions(createActionGroup(this)),
	mResentFileActions(createActionGroup(this)),
	mProjectActions(createActionGroup(this)),
	mToggleWindowActions(createActionGroup(this)),
	mNewProjAct(new QAction(this)),
	mOpenProjAct(new QAction(this)),
	mSaveProjAct(new QAction(this)),
	mCloseProjAct(new QAction(this)),
	mQuitAct(new QAction(this)),
	mEditProjAct(new QAction(this))
{
	
}

void DGUIEActionManager::addToggleWindowAction( QAction* act )
{
	mToggleWindowActions->addAction(act);
}

